home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
-
- #include <vcl.h>
- #pragma hdrstop
-
- #include "Info.h"
- #include "Main.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TfrmInfo *frmInfo;
- //---------------------------------------------------------------------------
- __fastcall TfrmInfo::TfrmInfo(TComponent* Owner)
- : TForm(Owner)
- {
- for (int i = 0; i<148;i++){
- //The list of genres is being filled with 148 elements using this cycle
- infoGenre->Items->Add(frmMain->AudioEditor1->FileInfo->GenreToString(i));
- }
- }
- //---------------------------------------------------------------------------
-
- void TfrmInfo::ResetData()
- {
- infoTitle->Text = Info->Title;
- infoArtist->Text = Info->Artist;
- infoAlbum->Text = Info->Album;
- infoGenre->ItemIndex = Info->Genre;
- infoCopyright->Text = Info->Copyright;
- infoComment->Text = Info->Comments;
- infoYear->Text = Info->Year;
- infoTrack->Text = Info->Track;
- infoComposer->Text = Info->Composer;
- infoURL->Text = Info->URL;
- infoEncodedBy->Text = Info->EncodedBy;
- }
- void __fastcall TfrmInfo::btnResetClick(TObject *Sender)
- {
- ResetData();
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmInfo::btnApplyClick(TObject *Sender)
- {
- Info->set_Title(StringToOleStr(infoTitle->Text)); //Sets a new title of the audio file subject
- Info->set_Artist(StringToOleStr(infoArtist->Text)); //Sets a new name of the artist who created the original subject of the file
- Info->set_Album(StringToOleStr(infoAlbum->Text)); //Sets a new Album name which contains the original audio file subject
- Info->Genre = infoGenre->ItemIndex; //Sets a new user-defined genre of the audio subject
- Info->set_Copyright(StringToOleStr(infoCopyright->Text)); //Sets new copyright information for the audio file
- Info->set_Comments(StringToOleStr(infoComment->Text)); //Sets new user-defined comments concerning an audio file
- try{
- Info->Year = infoYear->Text.ToInt(); //Sets the new year of the audio file//s subject to be first performed
- }catch(...){
- ShowMessage("Invalid Year Value");
- infoYear->SetFocus();
- return;
- }
- try{
- Info->Track = infoTrack->Text.ToInt();
- }catch(...){
- ShowMessage("Invalid Track Value");
- infoTrack->SetFocus();
- return;
- }
- Info->set_URL(StringToOleStr(infoURL->Text));
- Info->set_Composer(StringToOleStr(infoComposer->Text));
- Info->set_EncodedBy(StringToOleStr(infoEncodedBy->Text));
- }
- //---------------------------------------------------------------------------
- void __fastcall TfrmInfo::FormShow(TObject *Sender)
- {
- Info = frmMain->AudioEditor1->FileInfo;
- ResetData();
- }
- //---------------------------------------------------------------------------
-
-